package com.kgc.skProvider.controller;

import com.kgc.basic.util.ResponseMsg;
import com.kgc.collection.remote.SalesCollectionRemote;
import com.kgc.skProvider.service.SalesCollectionService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;

import java.util.Map;

@Controller
public class SalesCollectionController implements SalesCollectionRemote {

    private Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private SalesCollectionService salesCollectionService;

    @Override
    public ResponseMsg selectSalesCollectionByPage(Map<String, Object> map) {
        logger.info("SalesCollectionController  selectSalesCollectionByPage params{}",map.toString());
        ResponseMsg responseMsg =salesCollectionService.selectSalesCollectionByPage(map);
        logger.debug("SalesCollectionController  selectSalesCollectionByPage responseMsg{}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg insertSalesCollection(Map<String, Object> map) {
        logger.info("SalesCollectionController  insertSalesCollection params{}",map.toString());
        ResponseMsg responseMsg =salesCollectionService.insertSalesCollection(map);
        logger.debug("SalesCollectionController  insertSalesCollection responseMsg{}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg selectSalesCollectionDetail(Map<String, Object> map) {
        logger.info("SalesCollectionController  selectSalesCollectionDetail params{}",map.toString());
        ResponseMsg responseMsg =salesCollectionService.selectSalesCollectionDetail(map);
        logger.debug("SalesCollectionController  selectSalesCollectionDetail responseMsg{}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg updateSalesCollection(Map<String, Object> map) {
        logger.info("SalesCollectionController  updateSalesCollection params{}",map.toString());
        ResponseMsg responseMsg =salesCollectionService.updateSalesCollection(map);
        logger.debug("SalesCollectionController  updateSalesCollection responseMsg{}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg deleteSalesCollection(Map<String, Object> map) {
        logger.info("SalesCollectionController  deleteSalesCollection params{}",map.toString());
        ResponseMsg responseMsg =salesCollectionService.deleteSalesCollection(map);
        logger.debug("SalesCollectionController  deleteSalesCollection responseMsg{}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg checkSalesCollection(Map<String, Object> map) {
        logger.info("SalesCollectionController  checkSalesCollection params{}",map.toString());
        ResponseMsg responseMsg =salesCollectionService.checkSalesCollection(map);
        logger.debug("SalesCollectionController  checkSalesCollection responseMsg{}",responseMsg);
        return responseMsg;
    }

    @Override
    public ResponseMsg selectSalesCollectionByCode(Map<String, Object> map) {
        logger.info("SalesCollectionController  selectSalesCollectionByCode params{}",map.toString());
        ResponseMsg responseMsg =salesCollectionService.selectSalesCollectionByCode(map);
        logger.debug("SalesCollectionController  selectSalesCollectionByCode responseMsg{}",responseMsg);
        return responseMsg;
    }
}
